package mobi.hami.huapin.dao;

import java.util.List;

import mobi.hami.huapin.daobase.CrudMapper;
import mobi.hami.huapin.model.OpinionLeader;
import mobi.hami.huapin.model.OpinionLeaderExample;
import mobi.hami.huapin.model.Product;
import mobi.hami.huapin.model.SkuPictureMapping;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface OpinionLeaderMapper extends CrudMapper<OpinionLeader> {

    @Update("update opinion_leader set deleted=#{deleted} where id=#{id}")
    int  updateDelete (OpinionLeader product);

    /**
     * 用户前端查询 意见领袖
     * @param ids
     * @return
     */
    @Select("SELECT spu_id,nickname,headimgurl,slogan,distance from opinion_leader where spu_id in (${ids}) and deleted=0 order by order_num asc ")
    public List<OpinionLeader> getListForUser(@Param("ids")String ids);
}